Field of the Invention
The present invention relates to the field of embedded technology, and more particularly, to a control apparatus, an integrated circuit, and a management method for a stack.
Description of the Prior Art
The current embedded system, especially the embedded system with firmware running thereon, is typically used with a host system to achieve specific or singular function, while the current embedded system is also required to have features such as low power consumption, low cost, etc. This type of embedded system is usually arranged to run a simpler operating system (OS).
With the development of practical demands, for example, the development demands of smartphones or wearable devices, there are increasing needs for embedded systems that are capable of operating independently and achieving complete functions, such as GPS (Global Positioning System) position calculating function, gait recognition function, etc., so that the main system can stay in a hibernate/sleep state as often as possible.
Therefore, the embedded system needs to have certain capability of executing generic application software. When the generic application software is executed, it needs to store local variables into a stack in an internal memory. Because size of the internal memory is generally small, size of the stack is accordingly small (e.g., 4 kb) and is not allowed to exceed the predetermined range. As a result, an overflow resulting from insufficient stack size will occur at the time of executing certain generic application software.
In order to solve the problem, some conventional techniques have been proposed to directly expand the capacity of the internal memory. If a program code used for initializing a stack is already programmed in a read only memory (ROM), the size of the stack still cannot be increased even though the capacity of the internal memory has been expanded. In addition, the cost of embedded system increases greatly due to the capacity expansion of the internal memory.